CREATE TABLE [dbo].[TMUSUA]
(
[CO_USUA] [dbo].[TD_VC_008] NOT NULL,
[NO_USUA] [dbo].[TD_VC_050] NOT NULL CONSTRAINT [DF__TMUSUA__NO_USUA__57DD0BE4] DEFAULT (' '),
[NO_CLAV] [dbo].[TD_VC_020] NOT NULL,
[FE_MODI_CLAV] [dbo].[TD_DT_001] NOT NULL,
[CO_GRUP] [dbo].[TD_VC_008] NULL,
[DE_DIRE_MAIL] [dbo].[TD_VC_050] NULL,
[ST_ACTI] [dbo].[TD_VC_001_SINO] NULL,
[ST_EXPI_CLAV] [dbo].[TD_VC_001_SINO] NULL,
[FE_EXPI_CLAV] [dbo].[TD_DT_001] NULL,
[NU_DDME_CLAV] [dbo].[TD_SI_001] NULL CONSTRAINT [DF__TMUSUA__NU_DDME___5AB9788F] DEFAULT ((0)),
[ST_EXPI_USUA] [dbo].[TD_VC_001_SINO] NULL,
[FE_EXPI_USUA] [dbo].[TD_DT_001] NULL,
[ST_HORA] [dbo].[TD_VC_001_SINO] NULL,
[HO_INIC] [dbo].[TD_VC_004] NULL,
[HO_FINA] [dbo].[TD_VC_004] NULL,
[ST_MAST] [dbo].[TD_VC_001_SINO] NULL,
[TI_CONE] [dbo].[TD_VC_003] NULL,
[CO_EMPR_CONE] [dbo].[TD_VC_002] NULL,
[CO_UNID_CONE] [dbo].[TD_VC_003] NULL,
[NU_VECE_CONE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TMUSUA__NU_VECE___5E8A0973] DEFAULT ((0)),
[FE_ULTI_CONE] [dbo].[TD_DT_001] NULL,
[CO_USUA_SMAR] [dbo].[TD_VC_200] NULL,
[DE_DOMI_WIND] [dbo].[TD_VC_200] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMUSUA__CO_USUA___5F7E2DAC] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMUSUA__FE_USUA___607251E5] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TMUSUA__CO_USUA___6166761E] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TMUSUA__FE_USUA___625A9A57] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMUSUA] WITH NOCHECK ADD CONSTRAINT [CK__TMUSUA__ST_ACTI__58D1301D] CHECK NOT FOR REPLICATION (([ST_ACTI]='N' OR [ST_ACTI]='S'))
GO
ALTER TABLE [dbo].[TMUSUA] WITH NOCHECK ADD CONSTRAINT [CK__TMUSUA__ST_EXPI___59C55456] CHECK NOT FOR REPLICATION (([ST_EXPI_CLAV]='N' OR [ST_EXPI_CLAV]='S'))
GO
ALTER TABLE [dbo].[TMUSUA] WITH NOCHECK ADD CONSTRAINT [CK__TMUSUA__ST_EXPI___5BAD9CC8] CHECK NOT FOR REPLICATION (([ST_EXPI_USUA]='N' OR [ST_EXPI_USUA]='S'))
GO
ALTER TABLE [dbo].[TMUSUA] WITH NOCHECK ADD CONSTRAINT [CK__TMUSUA__ST_HORA__5CA1C101] CHECK NOT FOR REPLICATION (([ST_HORA]='N' OR [ST_HORA]='S'))
GO
ALTER TABLE [dbo].[TMUSUA] WITH NOCHECK ADD CONSTRAINT [CK__TMUSUA__ST_MAST__5D95E53A] CHECK NOT FOR REPLICATION (([ST_MAST]='N' OR [ST_MAST]='S'))
GO
ALTER TABLE [dbo].[TMUSUA] ADD CONSTRAINT [PK__TMUSUA__E73828D91CDC41A7] PRIMARY KEY CLUSTERED  ([CO_USUA]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMUSUA] ADD CONSTRAINT [FK__TMUSUA__CO_GRUP__41D8BC2C] FOREIGN KEY ([CO_GRUP]) REFERENCES [dbo].[TMGRUP_USUA] ([CO_GRUP])
GO
GRANT SELECT ON  [dbo].[TMUSUA] TO [public]
GRANT INSERT ON  [dbo].[TMUSUA] TO [public]
GRANT DELETE ON  [dbo].[TMUSUA] TO [public]
GRANT UPDATE ON  [dbo].[TMUSUA] TO [public]
GO
